package com.financing.controller.invest;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;

import com.financing.model.user.User;
import com.financing.service.invest.BidVirtualLogService;
import com.financing.util.Json;
import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;

public class BidVirtualLogController extends Controller {
	private BidVirtualLogService bidVirtualLog = new BidVirtualLogService();
	
	/**
	 * 标的数量虚增
	 * @throws Exception 
	 */
	@RequiresRoles(logical=Logical.OR,value={"admin","assets_second","admin1"})  
	public void index() throws Exception {
		User u = getAttr("user");
		Ret ret = bidVirtualLog.plus(getParaToInt("bidId",0), getParaToInt("unit",0),u.getId());
		if(ret.isOk()) {
			renderJson(Json.ok("标的数量修改成功！"));
		}else {
			renderJson(Json.error(ret.getStr("msg")));
		}
	}     
}
 